Page({
  request: {},
  data: {},
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    var orderNo = options.orderNo;
    this.request = require('../../common/networks');
    this.util = require('../../common/util');

    var app = getApp();
    wx.showLoading({
      title: '数据加载中...',
      mask: true
    })
    let page = this;
    this.request.searchByOrderNo({
      orderNo: orderNo
    }, function(data) {
      if (!!data) {
        var time = new Date();
        time.setTime(data.createTime * 1000);
        data.createTime = page.util.getYMD(time);
      }
      page.setData({
        order: data
      });
      wx.hideLoading();
    }, function() {
      page.util.showToast("Sorry，数据加载失败，请刷新重试");
      wx.hideLoading();
    });
  },


  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {
    wx.setNavigationBarTitle({
      title: '蒲公英家居-订单详情',
    })
  }
})